package 博客Test;

import java.util.Comparator;

public class Animal implements Comparable{
    String name;
    int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Animal(){

    }

    @Override
    public int compareTo(Object o) {
        System.out.println("我是comparable接口中的compareTo方法" +
                           "我的比较规则是永远都返回零");
        return 0;
    }
}





















